package tju.mic.medicine.servlet;

import com.sun.jersey.spi.container.servlet.ServletContainer;
import java.util.logging.Level;
import java.util.logging.Logger;


import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.ws.rs.core.Application;


/**
 * @author Chang Peng
 * @version 1.0
 */
public class MedicineServlet extends ServletContainer {
    @SuppressWarnings("compatibility:5888713509555642782")
    private static final long serialVersionUID = 1L;
    private static final Logger LOG = Logger.getLogger(MedicineServlet.class.getName());
    
    public MedicineServlet() {
        super();
    }


    public MedicineServlet(Application app) {
        super(app);
    }


    public MedicineServlet(Class<? extends Application> appClass) {
        super(appClass);
    }
    @Override
    public void init(ServletConfig config) throws ServletException {
        super.init(config);
        try {
            //load env configuration here...
            //Context initCtx = new InitialContext();
            //Context envCtx = (Context)initCtx.lookup("java:comp/env");
            Config.IS_DEBUG = "true".equalsIgnoreCase(config.getInitParameter("debug"));
            
        } catch (Exception ex) {
            LOG.log(Level.SEVERE, null, ex);
        }
        
    }
}
